home *** CD-ROM | disk | FTP | other *** search
/ Merciful 5 / Merciful - Disc 5.iso / software / r / real_3d / real3dv3.3b.dms / real3dv3.3b.adf / RPL.LZH / RPL / procmat.rpl < prev    next >
Text File  |  1995-05-04  |  1KB  |  67 lines

  1.  
  2. ( Procedural Material Examples
  3.  
  4. ?& PROCMAT.RPL NOT ?IF
  5. 17 CONSTANT PROCMAT.RPL
  6.  
  7. 3.1416 FCONSTANT PI
  8.  
  9. ( Some RPL Bump Handlers. To apply them in a material, use the Procedures 
  10. ( menu of the material window to select this file 'r3d3:rpl/procmat.rpl'.
  11. ( Then set Bump handler to RPL and type the name of the desired handler
  12. ( name to the Expression field 
  13.  
  14. : BumpWave
  15.     x F@ 10 F* PI t F@ F* F+ SIN a F@ 2 F+ F* bx F!
  16.     y F@ 10 F* PI t F@ F* F+ SIN b F@ 2 F+ F* by F!
  17. ;
  18.  
  19. : BumpCircular
  20.     r F@ 10 F* SIN 10 F* bx F!
  21.     r F@ 10 F* COS 10 F* by F!
  22. ;
  23.  
  24. : BumpAnimated
  25.     r F@ 10 F* 10 T F@ F* F+ SIN 10 F* bx F!
  26.     r F@ 10 F* 10 T F@ F* F+ COS 10 F* by F!
  27. ;
  28.  
  29. : BumpWaterDrop
  30.     z F@ 30 F* t F@ 30 F* F- COS 5 F* 5 F+
  31.     1 z F@ 30 F* 1 F+ F/ F*
  32.     2 z F@ 30 F* t F@ 30 F* F- DUP F* 1 F+ F/ F*
  33.     DUP bx F! by F!
  34. ;
  35.  
  36. : BumpFadedWave
  37.     z F@ 30 F* t F@ 30 F* F- COS 5 F* 5 F+
  38.     1 z F@ 30 F* 1 F+ F/ F*
  39.     DUP bx F! by F!
  40. ;
  41.  
  42. ( Some color RPL handlers: set Color handler to RPL and type the name 
  43. ( of the desired word to the Expression field 
  44.  
  45. : ColorWave
  46.     x F@ y F@ z F@ F+ F+ DUP DUP
  47.     50 F* SIN 127 F* 128 + R !
  48.     30 F* SIN 127 F* 128 + G !
  49.     10 F* SIN 127 F* 128 + B !
  50. ;
  51.  
  52. ( Use cylinder mapping for this
  53.  
  54. : ColorWood
  55.     z F@ 10 F* 1 FMOD 0.5 F> IF
  56.         255 R !
  57.         200 G !
  58.         120 B !
  59.     ELSE
  60.         200 R !
  61.         150 G !
  62.         0   B !
  63.     ENDIF
  64. ;
  65.  
  66. ?ENDIF
  67.